<extend name="base/Base" />
<block name="Style">
<!-- FooTable Plugin CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/vendor/plugins/footable/css/footable.core.min.css">
		<!-- Admin Forms CSS -->
		<link rel="stylesheet" type="text/css" href="__ABSOLUTEADMIN__/assets/admin-tools/admin-forms/css/admin-forms.css">
		
		<!-- Latest compiled and minified JavaScript -->
		
		<js href="__ADDON__/ueditor/js/jquery-1.11.0.min.js" />
		<js href="__ADDON__/ueditor/cms.admin.config.js" />    
		<js href="__ADDON__/ueditor/ueditor.all.min.js" />
		<link rel="stylesheet" href="/public/addon/style/css/bootstrap-select.css">
		<script src="/public/addon/style/js/bootstrap-select.min.js"></script>
		<script>
		$(function(){
			var url="__APP__/Home/Ueditor/Index/Addon/Ueditor.html";
			var ue = UE.getEditor('container',{
				serverUrl :url,
				UEDITOR_HOME_URL:'__ADDON__/ueditor/',
			});
			ue.ready(function(){
				ue.execCommand('serverparam', {
					'uid': "<?php echo getUID(); ?>",
				   'username': '<?php echo getUID(); ?>',
				});
			});
		})
		</script>
	
		<js href="__ADDON__/ajaxupload/js/jquery.js" />
		<js href="__ADDON__/ajaxupload/js/ajaxupload.js" />
		<script type="text/javascript">
		$(function(){
			var button = $('#upload_button'), interval;
			var confirmdiv = $('#uploadphotoconfirm');
			var fileType = "pic",fileNum = "one"; 
			
			new AjaxUpload(button,{
				action: "__APP__/Home/Upload/Image/Addon/AjaxUpload.html",
				name: 'userfile',
				onSubmit : function(file, ext){
				
					if(fileType == "pic")
					{
						if (ext && /^(jpg|png|jpeg|gif|JPG|mp3)$/.test(ext)){
							this.setData({
								'info': '文件类型为图片'
							});
						} else {
							 confirmdiv.text('文件格式错误，请上传格式为.png .jpg .jpeg 的图片');
							return false;               
						}
					}
								
					confirmdiv.text('文件上传中');
					
					if(fileNum == 'one')
						this.disable();
					
					interval = window.setInterval(function(){
						var text = confirmdiv.text();
						if (text.length < 14){
							confirmdiv.text(text + '.');                    
						} else {
							confirmdiv.text('文件上传中');             
						}
					}, 200);
				},
				onComplete: function(file, response){
					if(response != "success"){
						if(response =='2'){
							confirmdiv.text("文件格式错误，请上传格式为.png .jpg .jpeg 的图片");
						}else{
							
							confirmdiv.text("上传完成");
							
							$("#newbikephotoName").val(response);
							$("#newbikephoto").attr("src",response);	
							$("#imgurl").attr("value",response);						
							
						}
						
					}
										  
					window.clearInterval(interval);
								
					this.enable();
					
					if(response == "success")
					alert('上传成功');              
				}
			});
		});
		
		$(function(){
			var button = $('#upload_button1'), interval;
			var confirmdiv = $('#uploadphotoconfirm1');
			var fileType = "pic",fileNum = "one"; 
			
			new AjaxUpload(button,{
				action: "__APP__/Home/Upload/Image/Addon/AjaxUpload.html",
				name: 'userfile',
				onSubmit : function(file, ext){
				
					if(fileType == "pic")
					{
						if (ext && /^(jpg|png|jpeg|gif|JPG|mp3)$/.test(ext)){
							this.setData({
								'info': '文件类型为图片'
							});
						} else {
							 confirmdiv.text('文件格式错误，请上传格式为.png .jpg .jpeg 的图片');
							return false;               
						}
					}
								
					confirmdiv.text('文件上传中');
					
					if(fileNum == 'one')
						this.disable();
					
					interval = window.setInterval(function(){
						var text = confirmdiv.text();
						if (text.length < 14){
							confirmdiv.text(text + '.');                    
						} else {
							confirmdiv.text('文件上传中');             
						}
					}, 200);
				},
				onComplete: function(file, response){
					if(response != "success"){
						if(response =='2'){
							confirmdiv.text("文件格式错误，请上传格式为.png .jpg .jpeg 的图片");
						}else{
							
							confirmdiv.text("上传完成");
							
							$("#newbikephotoName1").val(response);
							$("#newbikephoto1").attr("src",response);	
							$("#imgurl1").attr("value",response);						
							
						}
						
					}
										  
					window.clearInterval(interval);
								
					this.enable();
					
					if(response == "success")
					alert('上传成功');              
				}
			});
		});
		</script>

</block>
<block name="Topbar">
								
 <!-- Start: Topbar -->
      <header id="topbar" class="ph10">
        <div class="topbar-left">
         <ul class="nav nav-list nav-list-topbar pull-left">
           
			<li   class="active" >
              <a href="__APP__/Mall/Page/Create.html"    >新增单曲</a>
            </li>
			<li     >
              <a  href="__APP__/Mall/Page/song.html"   >单曲管理</a>
            </li>
			
          </ul>
        </div>
      
      </header>
	  						
    				
</block>
<block name="Content">

<!-- START ROW -->

	<div class="row">

		<!-- NEW COL START -->
		<article class="col-md-offset-1 col-sm-12 col-md-12 col-lg-10">
			
			<!-- Widget ID (each widget will need unique ID)-->
			<div class="jarviswidget" id="wid-id-7" data-widget-editbutton="false" data-widget-custombutton="false">
				
				<!-- widget div-->
				<div>
					
					<!-- widget edit box -->
					<div class="jarviswidget-editbox">
						<!-- This area used as dropdown edit box -->
						
					</div>
					<!-- end widget edit box -->
					
					<!-- widget content -->
					<div class="widget-body no-padding">
						
						<form id="smart-form-register" action="__APP__/Mall/Page/Create" onSubmit="return qqq()"  enctype="multipart/form-data" method="post" class="smart-form">
							 <div class="col-md-4">
							<div class="form-group">
								<label for="exampleInputEmail1">请输入单曲名称</label>
								<input type="text"  name="name" id="name" class="form-control"  placeholder="请输入单曲名称" value="">
							  </div>
							  </div>
							  
							  <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请选择语言</label>
								<select class="form-control" name="langue">
									<volist name="langue_list" id="langue_list">
									<option value ="{$langue_list.id}">|-- {$langue_list.name}</option>
									</volist>
								</select>
							  </div>
							   </div>
							   
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请选择流派风格</label>
								 <select id="style" name="style[]" class="selectpicker show-tick form-control" multiple data-live-search="false">
									<volist name="style_list" id="style_list">
									<option value ="{$style_list.id}">{$style_list.name}</option>
									</volist>
								</select>
							  </div>
							   </div>
							  
							  <br/>
							  
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入作词</label>
								<input type="text"  name="lyrics" id="lyrics" class="form-control"  placeholder="请输入作词" value="{$data.lyrics}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入作曲</label>
								<input type="text"  name="compose" id="compose" class="form-control"  placeholder="请输入作曲" value="{$data.compose}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入录音</label>
								<input type="text"  name="record" id="record" class="form-control"  placeholder="请输入录音" value="{$data.record}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入混音</label>
								<input type="text"  name="mixing" id="mixing" class="form-control"  placeholder="请输入混音" value="{$data.mixing}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入演唱者</label>
								<input type="text"  name="singer" id="singer" class="form-control"  placeholder="请输入演唱者" value="{$data.singer}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入制作人</label>
								<input type="text"  name="producer" id="producer" class="form-control"  placeholder="请输入制作人" value="{$data.producer}">
							  </div>
							  </div>
							  
							   <div class="col-md-4">
							  <div class="form-group">
								<label for="exampleInputEmail1">请输入出品方</label>
								<input type="text"  name="producers" id="producers" class="form-control"  placeholder="请输入出品方" value="{$data.producers}">
							  </div>
							  </div>
							  <br/>
							  <br/><br/>
							  <br/>
							  <br/><br/>
							  <br/>
							  <br/>
							  <br/>
							  <br/>
							  <br/><br/>
							  <br/>
							  <br/><br/>
							  <br/>
							 
							  <div class="col-md-6">
							   <section>
						<label class="control-label" for="bike_type">&nbsp;</label>
							<input type="file" style="display:none" name="userfile">
							<input type="hidden" id="newbikephotoName1" name="mp3" value="" />
							<input type="hidden" id="oldbikephotoName1" value="" />
							<div class="controls" style="text-align:center;">
								<img  id="newbikephoto1" src="http://image.zaiyoudao.com/image.php/zyd_126.html" style="max-height:200px;max-width:200px;" />
								<span class="help-inline"></span>
								<br/>
								<div id="uploadphotoconfirm1"></div>
								<br/>
								<input type="hidden" name="mp3" id="imgurl1" value="" style="max-height:200px;max-width:200px;"  >
								<input type="button" class="btn btn-lg btn-primary" style="width:50%" id="upload_button1"  value="上传单曲" /><br/>
							</div>
							</section>
							</div>
							  
							    <div class="col-md-6">
							  <section>
						<label class="control-label" for="bike_type">&nbsp;</label>
							<input type="file" style="display:none" name="userfile">
							<input type="hidden" id="newbikephotoName" name="img" value="" />
							<input type="hidden" id="oldbikephotoName" value="" />
							<div class="controls" style="text-align:center;">
								<img  id="newbikephoto" src="http://image.zaiyoudao.com/image.php/zyd_126.html" style="max-height:200px;max-width:200px;" />
								<span class="help-inline"></span>
								<br/>
								<div id="uploadphotoconfirm"></div>
								<br/>
								<input type="hidden" name="img" id="imgurl" value="" style="max-height:200px;max-width:200px;"  >
								<input type="button" class="btn btn-lg btn-primary" style="width:50%" id="upload_button"  value="上传单曲封面" /><br/>
							</div>
							</section>
							  </div>
							  
							  <!-- <div class="col-md-12">
								<section>
									<label for="exampleInputEmail1">请输入歌词</label>
									<label class="input">
									 <script id="container" name="value" type="text/plain"></script>
									 </label>
								</section>
								</div> -->
								
								<div class="col-md-12">
								<div class="form-group">
								<label for="exampleInputEmail1">请输入单曲介绍</label>
								<textarea class="form-control" rows="3" name="intro" value="{$data.intro}"></textarea>
								</div>
								</div>
							<br>
							<input type="hidden" name="status" value="1" id="status"/>
							
							
							
							<footer class="col-md-6">
								<input type="hidden" name="form_id" value="{$form_id}">
								<button type="button" class="btn btn-primary" style="width:100%" onclick="danqu();">
									新增单曲
								</button>
							</footer>
							<footer class="col-md-6">
								<input type="hidden" name="form_id" value="{$form_id}">
								<button type="button" class="btn btn-primary" style="width:100%" onclick="caogao();">
									保存草稿
								</button>
							</footer>
								
						</form>						
						
					</div>
					<!-- end widget content -->
					
				</div>
				<!-- end widget div -->
				
			</div>
			<!-- end widget -->	

		</article>
		<!-- END COL -->

		
	<br>
	<br>
	</div>

	<!-- END ROW -->
	
</block>
<block name="Script">
	
  <!-- FooTable Plugin -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.all.min.js"></script>
   <!-- FooTable Addon -->
  <script src="__ABSOLUTEADMIN__/vendor/plugins/footable/js/footable.filter.min.js"></script>
  <!-- <script type="text/javascript" src="/public/addon/style/js/jquery.form.js"></script> -->

						<script>
							function qqq(){
								var style = $("#style").val();
								
							}
							function danqu(){
								$('#status').val(1);
								$('#smart-form-register').submit();
							}
							
							function caogao(){
								$('#status').val(2);
								$('#smart-form-register').submit();
							}
							
							
							//新增配置
							//新增配置
							function change(){  
							
								var username = $("#username").val();
								var nickname = $("#nickname").val();
								
								var tel = $("#tel").val();
								var email = $("#email").val();
								var img = $("#newbikephotoName").val();
								
								$.ajax({
									type:'POST',
									url:"__APP__/Admin/User/Create.html",
									data:{
										
										"username": username,
										"nickname": nickname,
										"tel": tel,
										"email": email,
										"img": img,
										
										
									},
									success:function(data){			
										var info = eval(data)
										if (info.errcode == 0) {
										
											layer.msg(info.errmsg);
											setTimeout(window.location.reload(),3000);
											
										}else{
											layer.msg(info.errmsg);
										}
									},
									error:function(){
										layer.msg('系统繁忙,请稍候重试！');
									}
								
								});	 
							} 
							 //$('#registSubmit').on('submit', function(){
								//  registPost()
							//		event.preventDefault() //阻止form表单默认提交
							//})
							
							function registPost() {
								 // jquery 表单提交   
								$("#registSubmit").ajaxSubmit(function(message) {   
								// 对于表单提交成功后处理，message为返回内容   
								});   
								return false;
							}
							 
							 
							</script>
 <script type="text/javascript">
  jQuery(document).ready(function() {

 

    // Init FooTable Examples
    $('.footable').footable();


  });
  </script>
</block>